package com.atguigu.lease.web.admin.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author: 刘安杰
 * @Date: 2024/8/16
 * @Time: 22:06
 * @Description:
 */
//需求：每隔3秒在控制台打印当前的日期
//@Component
public class SpringTaskTest {
    @Scheduled(cron = "0/3 * * * * ?")
    public void printDate(){
        System.out.println("new Date =" + new Date());
    }
}
